part of '../repository.dart';

const _kAmDialectValue = 'am';
const _kBrDialectValue = 'br';

class _DialectDto extends Equatable {
  const _DialectDto._internal({
    required this.dialectString,
  });

  final String dialectString;

  @override
  List<Object?> get props {
    return [
      dialectString,
    ];
  }

  factory _DialectDto.fromString(String s) {
    return _DialectDto._internal(
      dialectString: s,
    );
  }

  AssetDialect toEntity() {
    return switch (dialectString) {
      _kAmDialectValue => AssetDialect.am,
      _kBrDialectValue => AssetDialect.br,
      _ => throw UnimplementedError(),
    };
  }
}
